<?php

namespace common\models\credit_old_app_tables;

use Yii;

/**
 * This is the model class for table "{{%hjc_ignment_of_debt}}".
 *
 * @property int $hys_id
 * @property string $hys_bill_no 清单编号
 * @property string $hys_custom_name 客户名称
 * @property string $hys_order_no 订单号
 * @property string $hys_lastest_due_date 应收账款最晚到期日
 * @property string $hys_amount 应收账款余额
 * @property string $hys_note 备注
 * @property int $hys_created_at
 */
class SlHjcIgnmentOfDebt extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%hjc_ignment_of_debt}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_old_app');
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['hys_bill_no', 'hys_custom_name', 'hys_order_no', 'hys_lastest_due_date', 'hys_amount', 'hys_created_at'], 'required'],
            [['hys_amount'], 'number'],
            [['hys_note'], 'string'],
            [['hys_created_at'], 'integer'],
            [['hys_bill_no', 'hys_order_no'], 'string', 'max' => 100],
            [['hys_custom_name'], 'string', 'max' => 50],
            [['hys_lastest_due_date'], 'string', 'max' => 20],
            [['hys_order_no'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'hys_id' => Yii::t('app', 'Hys ID'),
            'hys_bill_no' => Yii::t('app', '清单编号'),
            'hys_custom_name' => Yii::t('app', '客户名称'),
            'hys_order_no' => Yii::t('app', '订单号'),
            'hys_lastest_due_date' => Yii::t('app', '应收账款最晚到期日'),
            'hys_amount' => Yii::t('app', '应收账款余额'),
            'hys_note' => Yii::t('app', '备注'),
            'hys_created_at' => Yii::t('app', 'Hys Created At'),
        ];
    }
}
